/// 条件操作符枚举
///
/// 用于定义查询条件中的操作符类型
enum CndOperator {
  /// 等于 =
  eq('='),

  /// 不等于 !=
  ne('!='),

  /// 大于 >
  gt('>'),

  /// 大于等于 >=
  ge('>='),

  /// 小于 <
  lt('<'),

  /// 小于等于 <=
  le('<='),

  /// 模糊匹配 LIKE
  like('LIKE'),

  /// 不匹配 NOT LIKE
  notLike('NOT LIKE'),

  /// 为空 IS NULL
  isNull('IS NULL'),

  /// 不为空 IS NOT NULL
  isNotNull('IS NOT NULL'),

  /// 包含在列表中 IN
  in_('IN'),

  /// 不包含在列表中 NOT IN
  notIn('NOT IN'),

  /// 范围查询 BETWEEN
  between('BETWEEN'),

  /// 不在范围内 NOT BETWEEN
  notBetween('NOT BETWEEN');

  const CndOperator(this.sql);

  /// SQL操作符字符串
  final String sql;

  /// 是否为空值检查操作符
  bool get isNullCheck => this == isNull || this == isNotNull;

  /// 是否为列表操作符
  bool get isListOperator => this == in_ || this == notIn;

  /// 是否为范围操作符
  bool get isRangeOperator => this == between || this == notBetween;

  /// 是否需要参数
  bool get needsParameter => !isNullCheck;
}
